<div id="left_panel">
    <div class="title">+ Push Climbing Tours Information</div>
    <div class="body_content">
        {{if isset( $Data["tourindex"])}}
        <h2>+ {{$Data["tourindex"]->Title}} - <span style="color:#990000;">${{$Data["tourindex"]->UnitPrice}}</span></h2>
        <div>{{$Data["tourindex"]->Content}}</div>
        <h2>+ Map</h2>
        <div class="map">
            <center>
                {{$Data["tourindex"]->PriceList}}
            </center>
        </div>
        <a href="{{base_url('cart/buytour/'|cat:$Data["tourindex"]->Alias)}}">
            <img src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" style="border: 0" border="0" alt="PayPal - The safer, easier way to pay online!"/>
        </a>
<!--        <a href="{{base_url('checkout/tour/'|cat:$Data["tourindex"]->Alias)}}">-->
        <img onclick="checkout_tour()" src="{{base_url()}}PushClimb/images/checkout_butt.png" style="border: 0;padding: 3px;">
<!--        </a>-->
        {{/if}}
    </div>
</div>
    <div id="checkout_tour" style="display: none;font-size: 16px;">
        <form action="{{base_url("sys/excution/nothing")}}" 
                  name="frmcheckout"
                  target="integration_asynchronous"
                  onsubmit="submitcheckout()"
                  method="post">
            <table>
                <tr>
                    <td style="width: 100px;padding-left: 20px">Name</td>
                    <td>
                        <input id="txtckname" name="txtckname" style="width: 200px" type="text"
                               value="{{if isset($_SESSION["push"]["user"])}}{{$_SESSION["push"]["user"]["Name"]}}{{/if}}"
                               />
                    </td>
                </tr>
                <tr>
                    <td style=";padding-left: 20px">Email</td>
                    <td>
                        <input id="txtckmail" name="txtckmail" style="width: 200px" type="text"
                               value="{{if isset($_SESSION["push"]["user"])}}{{$_SESSION["push"]["user"]["Email"]}}{{/if}}"
                               />
                    </td>
                </tr>
                <tr>
                    <td style=";padding-left: 20px">Phone</td>
                    <td>
                        <input id="txtckphone" name="txtckphone" style="width: 200px" type="text"
                               value="{{if isset($_SESSION["push"]["user"])}}{{$_SESSION["push"]["user"]["Phone"]}}{{/if}}"
                               />
                    </td>
                </tr>
                <tr>
                    <td style=";padding-left: 20px">Note</td>
                    <td>
                        <textarea id="txtcknote" name="txtcknote" style="width: 200px"></textarea>
                    </td>
                </tr>
            </table>
            <input type="submit" style="border: none;padding: 0;margin: 0;width: 0;height: 0"/>
        </form>
    </div>
    <script>
        function checkout_tour(){
            ShowConfirmDialogMessage($("#checkout_tour"), "Checkout this tour?",submitcheckout);
        }
        function submitcheckout(){
            if(isrunning)return;
            var url,data;
            url="{{base_url('checkout/tour')}}";

            data={
                TourID      :   "{{$Data["tourindex"]->ID}}",
                Name        :   $("#txtckname").val(),
                Email       :   $("#txtckmail").val(),
                Phone       :   $("#txtckphone").val(),
                Note         :   $("#txtcknote").val()
            }
            isrunning=true;
            debugAjax(url,data,function(result){
                isrunning=false;
                if(result.code>=0){
                    document.frmcheckout.reset();
                    ShowNoticeDialogMessage(result.msg);
                    CloseConfirmDialogMessage($("#checkout_tour"));
                }else{
                    ShowNoticeDialogMessage(result.msg);
                }
            });
            
        }
    </script>